(require 'srfi-1)
(define cria-chave
  (lambda (nome
      descricao
      saida)
    (let
        ((self-nome nome)
         (self-descricao descricao)
         (self-saida saida))

      (lambda (selector)
        (cond ((eq? selector 'get-nome)
               (lambda ()
                 self-nome))

              ((eq? selector 'set-nome)
               (lambda (novo-nome)
                 (set! self-nome novo-nome)))

              ((eq? selector 'get-descricao)
               (lambda ()
                 self-descricao))

              ((eq? selector 'set-descricao)
               (lambda (nova-descricao)
                 (set! self-descricao nova-descricao)))

              ((eq? selector 'get-saida)
               (lambda ()
                 self-saida))

              ((eq? selector 'set-saida)
               (lambda (nova-saida)
                 (set! self-saida nova-saida)))

              (else
               #f))))))
